package server;

/**
 * @author xingyi
 */
public class UrlUtils {
    public static String[] splitUrl(String url) {
        final int index = url.indexOf('/', 1);
        String contextPath;
        String path;
        if (index == -1) {
            contextPath = url;
            path = "/";
        } else {
            contextPath = url.substring(0, index);
            path = url.substring(index);
        }
        return new String[]{contextPath, path};
    }
}
